#include<bits/stdc++.h>
using namespace std;

int a[100010];

int main()
{
	int n, m;
	cin>>n;
	for(int i = 1;i <= n;i++)
		cin>>a[i];
	cin>>m;
	
	sort(a+1, a+n+1);
	
//	int flag = 0;
	for(int i = 1;i < n;i++)
	{
		if(a[i] >= m)
			break;
		
		int target = m-a[i];
		int index = lower_bound(a+i+1, a+n+1, target)-a;
		if(a[index] != target)
			continue; 
		if(index <= n)
		{
			cout<<a[i]<<" "<<a[index];
			return 0;
		}
	}
	cout<<"No";
	return 0;
}

